<%@ page language="java" session="true" isThreadSafe="true" contentType="text/html; charset=gbk"%>
<%@ page import="com.dc.remote.*,com.dc.adaptor.persistance.bean.*,java.io.*"%>
<%
	
    response.reset();
	response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
	response.setHeader("Pragma","no-cache"); //HTTP 1.0
	response.setDateHeader ("Expires", 0);

	String sFileName = "data";
    java.io.OutputStream o = response.getOutputStream();
    response.setContentType("application/octet-stream");//application/x-download //application/octet-stream  text/html;charset=utf-8//application/vnd.ms-powerpoint;charset=gbk
    response.setHeader("Content-Disposition","attachment;filename = " + new String(sFileName.getBytes(),"iso-8859-1"));//new String(articlename.getBytes(),"gb2312")// + "." + suffix //   
	try{
		String contentID = request.getParameter("contentID");
		ByteArrayInputStream fis = new ByteArrayInputStream( PackReSender.findPack(contentID).getBytes("GBK"));
	    byte[] buf = new byte[1024]; 
	    for(int i = fis.read(buf);i>-1;){
			o.write(buf,0,i);
	    	o.flush();
			i = fis.read(buf);
	    }
	    o.close();	   
		fis.close();
		out.clear();
		out = pageContext.pushBody();
    }catch(Exception e){
    	e.printStackTrace();
    }
%>

